﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Maticsoft.Common;

namespace StuEdu.Web.Notify
{
    public partial class AddNotify : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {

            string str = null;
            if (!string.IsNullOrEmpty(this.txtTitle.Text))
            {
                if (!string.IsNullOrEmpty(this.txtContent.Text))
                {
                    StuEdu.Model.Notify model = new Model.Notify();
                    model.notifyTitle = this.txtTitle.Text;
                    model.notifyContent = this.txtContent.Text;
                    model.notifyTime = DateTime.Now;
                    model.personName = this.txtName.Text;
                    model.isPush = this.chBox.Checked;

                    StuEdu.BLL.Notify bll = new BLL.Notify();
                    bll.ToNotify(model);
                    MessageBox.ShowAndRedirect(this, "发布成功", "List.aspx");
                }
                else
                {
                    Response.Write("<script>alert('内容不能为空')</script>");               
                }
            }
            else
            {
                Response.Write("<script>alert('标题不能为空')</script>");
            }

        }
    }
}